package homework;

import lesson.Util;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class Save extends JPanel implements ActionListener {
    private Atm atm;

    private Icon offImg = Util.getIcon("/buttonOff.jpg");
    private JButton  offBtn = new JButton(offImg);
    public Save(Atm atm){
        this.atm = atm;
        offBtn.setBounds(930,200,140,50);
        this.add(offBtn);

        offBtn.addActionListener(this);
        this.setLayout(null);
        this.setOpaque(false);

    }


    @Override
    public void actionPerformed(ActionEvent e) {
        if (e.getSource()==offBtn){
            System.out.println("11");
            atm.switchPanel("menu");
        }

    }
}
